let aud = new Audio();

aud.playSong = function(url){
	aud.src = url;
	aud.play();
}

// 监听音频播放状态.
aud.addEventListener("play",function(){
	console.log("播放中")
	this.vmStore.commit("changePlayerState","playing")
});
aud.addEventListener("pause",function(){
	console.log("暂停了")
	this.vmStore.commit("changePlayerState","pause")
});
aud.addEventListener("timeupdate",function(){
	// console.log("持续播放中")
	let currentTime = aud.currentTime;
	let currentDuration = aud.duration;
	// console.log(currentTime)
	this.vmStore.commit("getCurrentTime",{
		curTime:currentTime,
		cuDuration:currentDuration
	})
})
export default aud;	